﻿using System;
using System.Collections.Generic;

namespace Com.Lancetinc.Evs.Data
{
    /// <summary>
    /// 分页信息
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagingInfo<T>
    {
        /// <summary>
        /// 数据
        /// </summary>
        public IList<T> List { get; set; }

        /// <summary>
        /// 总件数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 每页件数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 第几页(从1开始)
        /// </summary>
        public int PageNo { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageCount => (int)Math.Ceiling(TotalCount * 1.0 / PageSize);
    }
}